package com.example.springboot.service.impl;


import com.example.springboot.dto.ZYOfficialWebsiteReqDTO;
import com.example.springboot.service.HttpService;
import com.example.springboot.utils.HttpUtils;
import com.example.springboot.vo.ResultGWVO;
import com.google.gson.Gson;
import org.springframework.stereotype.Service;

@Service
public class HttpServiceImpl implements HttpService {
    private String url = "https://khdatservice.chinapost-life.com/userCenter/v1/groupService/account/login";

    @Override
    public ResultGWVO getHttpPost(ZYOfficialWebsiteReqDTO zyOfficialWebsiteDTO) {
        Gson gson = new Gson();
        String json = gson.toJson(zyOfficialWebsiteDTO);
        String doPostJson = HttpUtils.doPostJson(url, json);
        ResultGWVO resultGW = gson.fromJson(doPostJson, ResultGWVO.class);
        return resultGW;
    }
}
